In an FA (Factory Automation) field, a sensor device called an image sensor (visual sensor) is widely used in order to measure and monitor a measurement object (hereinafter referred to as a “workpiece”) flowing in a line. The image sensor is constructed with a camera and an image processing device, and has a function of extracting and measuring necessary information by detecting the workpiece in the image through matching processing (template matching) with a previously-registered teacher object (hereinafter referred to as a “model” or a “pattern”). Output of the image sensor can be used in various applications such as identification, inspection, and sorting of the workpiece.
There are many needs to detect an object, such as a bag-packaged material or vegetable, a handwritten character, and a human body, the shape of which changes according to a situation or varies among individuals, from the image. A technology of detecting the object (hereinafter referred to as a “variable-shape object”) the shape of which changes is currently studied, and “distance transform” and “elastic matching” can be cited as a main technology.
The distance transform is a technology of obtaining a shortest distance from edges of pixels in the image and performing matching based on the shortest distance (Patent Document 1). In the distance transform, the matching can be performed with an allowance of an edge position coordinate between a model image and an input image.
The elastic matching is a technology of performing the matching by calculating a degree of similarity based on a correspondence (mapping function) between feature points of the model image and input image (Patent Documents 2 and 3). In the elastic matching, the matching can be performed with the allowance of the edge position coordinate between the model image and the input image.